<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
<title>Yogette's My Reservation Page</title>

        <style type="text/css">
            #sortable1 { list-style-type: none; margin: 0; padding: 0; width: 60%; }
            #sortable1 tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
            #sortable1 tr span { position: absolute; margin-left: -1.3em; }
            #sortable2 { list-style-type: none; margin: 0; padding: 0; width: 60%; }
            #sortable2 tr { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 1.4em; height: 18px; }
            #sortable2 tr span { position: absolute; margin-left: -1.3em; }
        </style>
        
<link href="<?php echo base_url(); ?>/yogette/css/style.css" rel="stylesheet" type="text/css" />
<link href="<?php echo base_url(); ?>/yogette/css/yogette.css" rel="stylesheet" type="text/css"/>

    </head>

    <body id="blog_entry" class="body-user">
         
        <div class="main-wrapper-blog" style=" height:auto; position:absolute ; " >
            <img class="pinkcircle" src="<?php echo base_url(); ?>yogette/images/pinkCircle.jpg"/>
            <div class="Container"></div>
            <div class="menulist">
                <ul class="menulist-ul">
                    <li><img class="ice-cream" src="<?php echo base_url(); ?>yogette/images/logoIcon.jpg"/><a href="/yogette/member"><img src="<?php echo base_url(); ?>yogette/images/mainboard.jpg" class="home" alt="Yogette's Homepage"/></a></li>
                </ul>
            </div>
            <div style=" margin-left: 70.5%;">
                <?php if (!$this->session->userdata('c_logged_in')) { ?>
                    |-| <a class="metadata-blog-div-a" href="/yogette/user/login">Login</a> |-|
                <?php } ?>
                <?php if ($this->session->userdata('c_logged_in')) { ?>
                    |-| <a class="metadata-blog-div-a" href="/yogette/cart/logout">LogOut</a> |-|
                    <?php if ($items != false) {  ?>
                    |-| <a class="metadata-blog-div-a" href="/yogette/cart/checkout">CheckOut</a> |-|
                     <?php } ?>
                <?php } ?>
            </div>
            
            <div class="content" style="margin-top: 6em ">
            
               <div class="blog-div-th" style="text-align: center; margin-top: 0em">Available Reservations</div>
            
                        <!-- check if there is movies queue list and print it or not and print the error -->
                        <div class="data" style ="text-align: center; margin: 0em 10em 10em 10em;" >
                            <?php
                            if ($items == false) {
                                ?> 
                                        <table style="margin-left: 25em;  " cellspacing="0" cellpadding="4" border="4">
                                            <thead>
                                                <tr>
                                                <td><h1>Result</h1></td>
                                                </tr>
                                            </thead>
                                            <tbody id="sortable1">
                                                <tr>
                                                <td><h1>You don't have any Reservations</h1></td>
                                                </tr>
                                            </tbody>
                                        </table>
                        </div>
                        <?php } else { ?>
                        <div class="data" style ="text-align: center; margin: 0em 10em 10em 8em;  ">   
                            <table cellspacing="1" cellpadding="4" border="4">
                                <thead>
                                <tr>
                                <td>Reserve ID</td>
                                <td>Reserve Date</td>
                                <td>Reserve Time Start</td>
                                <td>Reserve Time End</td>
                                <td>Special Type</td>
                                <td>Special Description</td>
                                <td>Special Price</td>
                                <td>Store Location</td>
                                <?php if ($this->session->userdata('c_logged_in')) { ?> 
                                <td>Action</td>
                                 <?php } ?>
                                </tr>
                                </thead>
                                <tbody id="sortable1">
                                    <?php
                                    foreach ($items as $items) {
                                    $reserv_id = $items->reserv_id;
                                    echo "<tr id='item_$reserv_id' class='ui-state-default'>"; ?>
                                        <td><?php echo $items->reserv_id; ?></td>
                                        <td><?php echo $items->reserv_date; ?></td>
                                        <td><?php echo $items->reserv_time_start; ?></td>
                                        <td><?php echo $items->reserv_time_end; ?></td>
                                        <td><?php echo $items->spe_type; ?></td>
                                        <td><?php echo $items->special_desc; ?></td>
                                        <td><?php echo $items->spe_price; ?></td>
                                        <td><?php echo $items->store_loc; ?></td>  
                                       <?php if ($this->session->userdata('c_logged_in')){ ?> 
                                        <td><?php echo anchor('yogette/reserve/cancel_reservation/'.$items->reserv_id , 
                                                'Cancel-Reservation', array('class' => 'Delete')); ?>
                                        </td>
                                        <?php } ?>
                                    <?php echo "</tr>"; } ?>
                                        
                                </tbody>
                            </table>
                         </div>   
                           <?php } ?>                
            </div>
        </div>
      
                      
        <!-- footer start -->
        <div class="pre-footer">   
        </div>
        <div class="footer">
            <div>
                <p class="footer-p1">yogurt is healthy</p>
            </div>
            <div>
                <p class="footer-p2">Copyright &COPY; 2010 YOGETTE.</p>
            </div>
        </div>
        <img class="post-footer" src="<?php echo base_url(); ?>yogette/blank.jpg" id="blank" name="blank" /> 
        <!-- footer ends-->

    </body>
</html>